using System;
using System.ComponentModel;
using System.Transactions;

using SIS.ENT;
using SIS.DAL;


namespace SIS.BLL {

/// <summary>
/// The FamilyMemberAddressTableManager class is responsible for managing BO.FamilyMemberAddressTable objects in the system.
/// </summary>
[DataObjectAttribute()]
public class FamilyMemberAddressTableManager
  {

#region "Public Methods"

/// <summary>
/// Gets a list with all FamilyMemberAddressTable objects in the database.
/// </summary>
/// <returns>A list with all FamilyMemberAddressTable from the database when the database contains any, or null otherwise.</returns>
[DataObjectMethod(DataObjectMethodType.Select, true)]
public static FamilyMemberAddressTableList GetList(){
return FamilyMemberAddressTableDB.GetList();
}

/// <summary>
/// Gets a single FamilyMemberAddressTable from the database without its data.
/// </summary>
/// <param name="familyMemberAddressKey">The FamilyMemberAddressKey of the FamilyMemberAddressTable in the database.</param>
/// <returns>A FamilyMemberAddressTable object when the FamilyMemberAddressKey exists in the database, or <see langword="null"/> otherwise.</returns>
[DataObjectMethod(DataObjectMethodType.Select, false)]
public static FamilyMemberAddressTable GetItem(int familyMemberAddressKey){
return GetItem(familyMemberAddressKey, false);
}

[DataObjectMethod(DataObjectMethodType.Select, false)]
public static FamilyMemberAddressTable GetItemByUserAccountKey(int UserAccountKey)
{
    FamilyMemberAddressTable _FamilyMemberAddress = FamilyMemberAddressTableDB.GetItemByUserAccountKey(UserAccountKey);
    return _FamilyMemberAddress;
}

/// <summary>
/// Gets a single FamilyMemberAddressTable from the database.
/// </summary>
/// <param name="familyMemberAddressKey">The FamilyMemberAddressKey of the FamilyMemberAddressTable in the database.</param>
/// <param name="getFamilyMemberAddressTableRecords">Determines whether to load all associated FamilyMemberAddressTable records as well.</param>
/// <returns>
/// A FamilyMemberAddressTable object when the FamilyMemberAddressKey exists in the database, or <see langword="null"/> otherwise.
/// </returns>
[DataObjectMethod(DataObjectMethodType.Select, false)]
public static FamilyMemberAddressTable GetItem(int familyMemberAddressKey, bool getFamilyMemberAddressTableRecords){
FamilyMemberAddressTable myFamilyMemberAddressTable = FamilyMemberAddressTableDB.GetItem(familyMemberAddressKey);
return myFamilyMemberAddressTable;
}

/// <summary>
/// Saves a FamilyMemberAddressTable in the database.
/// </summary>
/// <param name="myFamilyMemberAddressTable">The FamilyMemberAddressTable instance to save.</param>
/// <returns>The new FamilyMemberAddressKey if the FamilyMemberAddressTable is new in the database or the existing FamilyMemberAddressKey when an item was updated.</returns>
[DataObjectMethod(DataObjectMethodType.Update, true)]
public static int Save(FamilyMemberAddressTable myFamilyMemberAddressTable){
using (TransactionScope myTransactionScope = new TransactionScope()){
int familyMemberAddressTableFamilyMemberAddressKey = FamilyMemberAddressTableDB.Save(myFamilyMemberAddressTable);

//  Assign the FamilyMemberAddressTable its new (or existing FamilyMemberAddressKey).
myFamilyMemberAddressTable.FamilyMemberAddressKey = familyMemberAddressTableFamilyMemberAddressKey;

myTransactionScope.Complete();

return familyMemberAddressTableFamilyMemberAddressKey;
}
}

/// <summary>
/// Deletes a FamilyMemberAddressTable from the database.
/// </summary>
/// <param name="myFamilyMemberAddressTable">The FamilyMemberAddressTable instance to delete.</param>
/// <returns>Returns true when the object was deleted successfully, or false otherwise.</returns>
[DataObjectMethod(DataObjectMethodType.Delete, true)]
public static bool Delete(FamilyMemberAddressTable myFamilyMemberAddressTable){
return FamilyMemberAddressTableDB.Delete(myFamilyMemberAddressTable.FamilyMemberAddressKey);
}

#endregion

}

}
